import { createSlice } from "@reduxjs/toolkit";

interface IAppState{
    collapsed:boolean
}

const initialState:IAppState={
    collapsed:localStorage.getItem("collapsed")==="true"
}

export const appSlice=createSlice({
    name:'collapse',
    initialState,
    reducers:{
        changeCollapse(state){
            state.collapsed=!state.collapsed
        }
    }
})

export const {changeCollapse}=appSlice.actions
export default appSlice.reducer